home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 for Intel / NeXTSTEP 3.2 for Intel.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbaltcolid.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  1.5 KB  |  61 lines

  1. .Na "dbaltcolid" 
  2. .Aa
  3. .Fu
  4. Return the column id for a compute column.
  5. .Ih "compute column, returning operand column id of"
  6. .Sy
  7. .Sf "int dbaltcolid(dbproc, computeid, column)"
  8. .Sp "DBPROCESS" "*dbproc"
  9. .Sp "int" "computeid"
  10. .Sp "int" "column"
  11. .Co
  12. .Bl
  13. This routine returns the \f2select-list\f1 id for a compute column.
  14. For example, given the SQL statement:
  15. .SD
  16. .in +5n
  17. .ne 3
  18. select dept, name from employee
  19.     order by dept, name
  20.     compute count(name) by dept
  21. .in -5n
  22. .ED
  23. the call
  24. .I "dbaltcolid(dbproc, 1, 1)"
  25. will return 2, since \f2name\f1 is
  26. the second column in the \f2select-list\f1.
  27. .Bz
  28. .Pa
  29. .Pi dbproc
  30. A pointer to the DBPROCESS structure that provides the connection
  31. for a particular front end/\*S process.  It contains all the
  32. information that \*L uses to manage communications and data between the
  33. front end and \*S.
  34. .Pi computeid
  35. The id that identifies the particular compute row of interest.
  36. A SQL SELECT statement may have multiple COMPUTE clauses, 
  37. each of which returns a separate compute row.
  38. The \f2computeid\f1 corresponding to the
  39. first COMPUTE clause in a SELECT is 1.
  40. The \f2computeid\f1 is returned by \f2dbnextrow()\f1 
  41. or \f2dbgetrow().\f1
  42. .Pi column
  43. The number of the compute column of interest.  The first column in a \f2select-list\f1 is 1.
  44. .in -.375i
  45. .Re
  46. .br
  47. The \f2select-list\f1 id for the compute column.
  48. The first column in a \f2select-list\f1 is 1.  If either the
  49. .I "computeid"
  50. or the
  51. .I column
  52. are invalid, \f2dbaltcolid()\f1 returns -1.
  53. .Sa
  54. dbadata,
  55. dbadlen,
  56. dbaltlen,
  57. dbgetrow,
  58. dbnextrow,
  59. dbnumalts,
  60. dbprtype
  61.